#include "uiwidgetdemo.h"
#include <QButtonGroup>
#include <QVBoxLayout>
#include <QPushButton>
#include <QDebug>
#include "stackedwidget/stackeddialog.h"
UIWidgetDemo::UIWidgetDemo(QWidget *parent) :
    QWidget(parent)
{
    setGeometry(100,100,400,400);
    QVBoxLayout *layout=new QVBoxLayout();
    QButtonGroup *buttonGroup=new QButtonGroup(this);

    QPushButton* button1=new QPushButton(NULL);
    button1->setGeometry(0,0,60,30);
    button1->setText("StackedWidget");
    buttonGroup->addButton(button1,0);

    layout->addWidget(button1);
    setLayout(layout);

    connect(buttonGroup,SIGNAL(buttonClicked(int)),this,SLOT(buttonClicked(int)));
}
void UIWidgetDemo::buttonClicked(int id)
{
    qDebug()<<"button id:"<<id;
    switch(id)
    {
    case 0:
        break;
    }
    StackedDialog dialog;
    dialog.exec();
}
